package com.kzj.common.enumerate;

public enum RoleEnum {
    TEACHER("teacher"),
    ADMINISTRATOR("administrator"),
    STUDENT("student");
    private String value;
    RoleEnum(String value)
    {
        this.value=value;
    }
    static public RoleEnum getRoleByValue(String value)
    {
        for (RoleEnum roleEnum : values()) {
            if(roleEnum.value.equals(value))
                return roleEnum;
        }
        throw new RuntimeException("未知的角色");
    }

}
